<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>prop</title>
    <script src="../../js/jquery.1.8.3.min.js"></script>
    <script>
        $(function () {
            $("#btn1").click(function () {
                $(":checkbox").prop("checked",true);
            });

            $("#btn2").click(function () {
                $(":checkbox").prop("checked",false);
            });

            $("#btn3").click(function () {
                $(":checkbox").prop("disabled",true);
            });

            $("#btn4").click(function () {
                $(":checkbox").prop("disabled",false);
            })
        })
    </script>
</head>
<body>
    <input id="i1" type="checkbox">
    <input id="i2" type="checkbox">

    <button id="btn1">选中</button>
    <button id="btn2">不选</button>

    <button id="btn3">失效</button>
    <button id="btn4">有效</button>
</body>
</html>